package Si.Assign1.Model;

import java.io.Serializable;
import java.sql.Clob;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import java.sql.Clob;

@Entity
@Table(name="Products")
@NamedQueries(
     {
    @NamedQuery(name="listProducts",
                query="SELECT p FROM Product p"),
    @NamedQuery(name="getProductById",
                query="SELECT p FROM Product p WHERE p.id = :id"),
    @NamedQuery(name="getProductByName",
                query="SELECT p FROM Product p WHERE p.name = :name")
     }
		)

public class Products 
{
	 public Products(){}
	 
	 /*
	  * Properties
	  */
	 
	 /*
	  * Set and get id
	  */
	 public int getId() 
	 {   return id;   }
	 public void setId(int id)
	 {   this.id = id; }

	 /*
	  * Set and get name
      */
	 public String getName()
	 {   return name;   }
	 public void setName(String name)
	 {   this.name = name;  }
	 
	 /*
	  * Set and get sku
	  */
	 public String getSku()
	 {   return sku;  }
	 public void setsku(String sku)
	 {   this.sku = sku;  }
	 
	 /*
	  * Set and get description
      */
	 public Clob getDescription()
	 {   return description;   }
	 public void setDescription(Clob description)
	 {   this.description = description;  }
	 
	 /*
	  * Set and get purchase_price
	  */
	 public Double getPurchase_price()
	 {   return purchase_price;  }
	 public void setPurchase_price(Double purchase_price)
	 {   this.purchase_price = purchase_price;  }
	 
	 /*
	  * Set and get id
	  */
	 public Double getSalePrice()
	 {   return salePrice;  }
	 public void setSalePrice(Double salePrice)
	 {   this.salePrice = salePrice; }
	 
	 /*
	  * Set and get product_type
      */
	 public int getProductType()
	 {   return productType;   }
	 public void setProductType(int productType)
	 {   this.productType = productType;  }
	 
	 @Id
	 @GeneratedValue(strategy=GenerationType.IDENTITY)
	 @Basic(optional=false)
	 @Column(name="id", nullable=false)
	 private int id;
	 @Column(name="name", length=255, nullable=false)
	 private String name;
	 @Column(name="sku", length=255, nullable=false)
	 private String sku;
	 @Column(name="description", length=1048576, nullable=false)
	 private Clob description;
	 @Column(name="purchase_price", length=10, nullable=false)
	 private Double purchase_price;
	 @Column(name="sale_price", length = 10, nullable=false)
	 private Double salePrice;
	 @Column(name="product_type", nullable=true)
	 private int productType;

}
